import {reactive} from "vue"

// 物业品质 - 智能表对接 - 规则类型
export const ruleTypeList = reactive([
	{
		type: 'select',
		label: '规则类型',
		isRequired: true,
		isControlOption: true,
		optionList: [],
		labelWidth: '115px',
		keyName: 'dicValue',
		valName: 'dicName',
		bindFieldName: 'ruleType',
		bindFieldVal: '',
	},
	{
		type: 'select',
		label: '智能表类型',
		isRequired: true,
		optionList: [
			{ key: 1, label: '电表' },
			{ key: 2, label: '水表' },
		],
		labelWidth: '115px',
		keyName: 'key',
		valName: 'label',
		bindFieldName: 'meterType',
		bindFieldVal: '',
	},
]);

//物业品质 - 智能表对接 - 规则信息（朝合公区和商户电表）
export const ruleInfoListBJCH = reactive([
	{
		type: 'text',
		label: '规则名称',
		labelWidth: '115px',
		isRequired: true,
		bindFieldName: 'ruleName',
		bindFieldVal: '',
	},
]);

//物业品质 - 智能表对接 - 规则信息（物业-公区）
export const ruleInfoPropertyAreaList = reactive([
	{
		type: 'text',
		label: '规则名称',
		isRequired: true,
		labelWidth: '115px',
		bindFieldName: 'ruleName',
		bindFieldVal: '',
	},
	{
		type: 'text',
		label: '梧桐项目编码',
		labelWidth: '115px',
		bindFieldName: 'projectCode',
		bindFieldVal: '',
	},
	{
		type: 'text',
		label: '电表项目ID',
		labelWidth: '115px',
		bindFieldName: 'proId',
		bindFieldVal: '',
	},
	{
		type: 'radio',
		label: '电表信息',
		isRequired: true,
		optionList: [
			{ key: 0, label: '自动' },
			{ key: 1, label: '手动' },
		],
		keyName: 'key',
		valName: 'label',
		bindFieldName: 'status',
		bindFieldVal: 1,
	},
	{
		type: 'text',
		label: '电表ID(,分隔)',
		labelWidth: '115px',
		bindFieldName: 'no',
		bindFieldVal: '',
		reasonObj: {
			filedName: 'status',
			filedVal: [1],
		},
	},
]);

//物业品质 - 智能表对接 - 触发频率
export const ruleFrequencyList = reactive([
	{
		type: 'text',
		label: 'Cron表达式',
		isRequired: true,
		labelWidth: '115px',
		bindFieldName: 'jobCron',
		bindFieldVal: '',
	},
	{
		type: 'text',
		label: '解析结果',
		isDisabled: true,
		labelWidth: '115px',
		bindFieldName: 'frequencyStr',
		bindFieldVal: '',
	},
]);

//物业品质 - 智能表对接 - 是否开启
export const ruleOpenList = reactive([
	{
		type: 'radio',
		label: '是否开启',
		isRequired: true,
		optionList: [
			{ key: 1, label: '开启' },
			{ key: 0, label: '关闭' },
		],
		keyName: 'key',
		valName: 'label',
		labelWidth: '115px',
		bindFieldName: 'jobStatus',
		bindFieldVal: 1,
	},
]);
